I tend to favor factories and datasets over fixtures, but
getting rid of the user fixtures generally means a lot of work in
the boilerplate restful_auth tests.
As one step in the right direction, I made a small tweak to
login_as. If you pass a user model (or whatever model you chose to
authenticate) it will use that instead of looking for a fixture.
I've attached the git diff patch to this ticket.
This makes divorcing fixtures in restful_auth possible.
I've also thought about making it downright pleasant by modifying
the TestUnit functional tests to be more fixture-agnostic. My first
thought is to limit the fixture calls (ie, users(:quentin) down to
just once in the setup method. That way, a developer could
change:
def setup @user = users(:quentin) end
to:
def setup @user = Factory.create(:user) end
at the top of tests and most, if not all, of the change is done.
Feedback on this idea would be appreciated.